/*******************************************************************************
 * Copyright (c) 2008, 2010 VMware Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   VMware Inc. - initial contribution
 *******************************************************************************/

package greenpages.web.core;

import greenpages.Menu;
import greenpages.MenuItem;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Controller class for GreenPages web application.
 * <p/>
 * 
 * This class is configured using Spring 2.5-style MVC annotations.
 * Documentation for this feature can be found <a href=
 * "http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-annotation"
 * >here</a>.
 * <p/>
 * 
 * The use of {@link Controller} makes this class eligible for autodetection by
 * &lt;context:component-scan/&gt; in the context configuration.
 */
@Controller
public class CoreController {
	
	@Autowired
	private Menu menu;

	@RequestMapping("/menu.htm")
	public List<MenuItem> menu() {
		return this.menu.getItems();
	}

	@RequestMapping("/home.htm")
	public void home() {
	}

}
